<div class='_line'></div>
<div  style='float:left; '>
    <a href="/user/barber/action" style='font-size:2rem'>活动 </a>&nbsp;&nbsp;&nbsp;&nbsp;
    <a href="<?php echo shop_buildUrl('/user/coupon/check');?>" style='font-size:2rem' >优惠劵 </a>
</div>
<div class='_line'></div>
<div class='_line'></div>
<div class='_cut'></div>
<div id='content'>
<?php foreach($actions as $k=>$v){ ?>
<?php if($k%3==0){ ?>
<div class='row'>
    <?php }?>
    <div class='col-sm-3 col-md-4 full'>
        <div class='thumbnail' style="margin-bottom:10px">
            <div style="height:12rem;overflow: hidden">
                <a target="_blank" href='<?php echo b_buildUrl("/user/action/info?aid=".$v['id']."&model_type=".$v['model_type']);?>'><img class='_img' src='/public/images/kaka.png' style='width:100%;'/></a>
            </div>
        </div>
        <div class='caption' style='overflow: hidden'>
            <span style="margin-left: 6px"><a class='_a' href='<?php echo b_buildUrl("/user/action/info?aid=".$v['id']."&model_type=".$v['model_type']);?>'>{$v.action_name}</a></span>
            <div>
                <span style="margin-left: 6px">参加人数：<?php echo $v['num'];?></span>
                <span style="margin-left: 6px">活动状态：<?php echo $v['status_name'];?></span>
            </div>
        </div>
    </div>
    <?php if(($k+1)%3==0 || $actions[$k+1]['id']<1){ ?>
</div>
<?php } ?>
<?php } ?>
</div>
<div class="clear"></div>
<script type='text/javascript'>
    var number = 12;
    function loaddata()
    {
        if(number ==-1){
            return;
        }
        totalheight = parseFloat($(window).height()) + parseFloat($(window).scrollTop());

        if ($(document).height() <= totalheight)
        {
            var type = $("#type").val();
            $.ajax({ url: "<?php echo b_buildUrl('/user/barber/appendaction');?>&start="+number+"&type="+type,async:true, success: function(msg){
                    if(msg == 'false'){
                        number = -1;
                        return ;
                    }
                    var html = "";
                    msg = eval('(' + msg + ')');
                    $.each(msg,function(i,v){
                        if(i%3==0){
                            html += "<div class='row'>";
                        }
                        html += "<div class='col-sm-3 col-md-4 full'>";
                        html += "<div class='thumbnail' style='margin-bottom:10px'>";
                        html += "<div style='height:12rem;overflow: hidden'>";
                        html += "<a target='_blank' href='<?php echo b_buildUrl('/user/action/info');?>&aid=";
                        html += v.id;
                        html += "'><img class='_img' src='";
                        html += v.logo;
                        html += "' style='width:100%;'/></a></div></div><div class='caption'><span style='margin-left: 6px'><a class='_a' href='<?php echo buildUrl('/user/action/info',$barber_id);?>?aid=";
                        html += v.id;
                        html += "'>";
                        html += v.action_name;
                        html += "</a></span>";
                        html += '<div><span style="margin-left: 6px">参加人数：';
                        html += v.num;        
                        html += '</span><span style="margin-left: 6px">活动状态：';
                        html += v.status_name;        
                        html += "</span></div></div></div>";
                        if((i+1)%3==0){
                            html += "</div>";
                        }
                        number += 1;
                    });
                    $('#content').append(html);
            }});
        }
    }

    $(window).scroll(function () {
        loaddata();
    });
   
</script>